﻿{include file="public/header"}
<title>订单录入</title>
</head>
<body>
<style>
    .col-sm-1 {
        width: 20.333333%;
        text-align: center;
    }
</style>

<article class="page-container">
    <form>
        <div class="ch-row ch-info-form">
            <div class="flex1">验收项目：</div>
            <div class="flex3">
                <input type="text" name="title" class="title form-control" placeholder="验收项目">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">验收标准：</div>
            <div class="flex3">
                <textarea placeholder="验收标准" name="scesn" class="form-control"> </textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">验收和质保备注：</div>
            <div class="flex3">
                <textarea placeholder="验收和质保备注" name="service_contents" class="form-control"> </textarea>

            </div>
        </div>
        <input type="hidden" name="parents_id" value="{$data}">
        <div class="ch-row ch-info-form">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100%;" type="button"><i
                        class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</article>
{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src="{:Url('index/Warranty/add')}?id=0";
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){

                            window.parent.location.reload(); //刷新父页面
                            parent.layer.close(index);  // 关闭layer

                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
</script>
</body>
</html>